package tests.pojos;

import java.util.ArrayList;


import tester.cobertura.Instrument;

public class AuthorWithArrays {
	ArrayList<BookWithArrays> bookList;
	String name;
	
	public AuthorWithArrays(){
		this.bookList = new ArrayList<BookWithArrays>();
		this.name = "";
	}
	
	public AuthorWithArrays(String name){
		this.name = name;
		bookList = new ArrayList<BookWithArrays>();
	}
	
	public AuthorWithArrays(String name, ArrayList<BookWithArrays> bookList){
		this.name = name;
		this.bookList = bookList;
	}
	
	public void addBook(BookWithArrays b){
		this.bookList.add(b);
	}
	
	public BookWithArrays getFirstBook(){
		return (bookList.size() > 0 ? bookList.get(0) : null);
	}

	public BookWithArrays[] getBooks(){
		return (BookWithArrays[]) bookList.toArray();
	}

	public void setName(String name){
		this.name = name;
	}
	
	public String getName(){
		return name;
	}
}
